/*
 * This class define how blocks organize in a whole cube and define movement of
 * a cube.
 */

#ifndef CUBE_H
#define CUBE_H
#include "block.h"
#include <vector>
#include <GL/glut.h>

    static int vertex_array[][3] = 
    {
        1, 1, 1,        //0
        1, 1, 0,        //1
        1, 1, -1,       //2

        1, 0, 1,        //3
        1, 0, 0,        //4
        1, 0, -1,       //5

        1, -1, 1,       //6
        1, -1, 0,       //7
        1, -1, -1,      //8

        0, 1, 1,        //9
        0, 1, 0,        //10
        0, 1, -1,       //11

        0, 0, 1,        //12
        0, 0, -1,       //13

        0, -1, 1,       //14
        0, -1, 0,       //15
        0, -1, -1,      //16

        -1, 1, 1,       //17
        -1, 1, 0,       //18
        -1, 1, -1,      //19

        -1, 0, 1,       //20
        -1, 0, 0,       //21
        -1, 0, -1,      //22

        -1, -1, 1,      //23
        -1, -1, 0,      //24
        -1, -1, -1,     //25
    };

//static int moveIndex


class Cube
{
private:
    Block *pBlocks[26];
    //vector<char> movement;      //parameter to recored movement
    //GLfloat speed;
    char state;
    /* state
     * n: no move is inserted
     * f: front
     * b: back
     * u: up
     * d: down
     * l: left
     * r: rigth
     */
    GLfloat step;  //speed of rotation


public:
    Cube();     //initialize an organzied cube
    void glDraw();   //draw a cube
    //void rotate();  //rotate blocks in array
    void rotate(char);
    //void rotate(vector<char>);
    ~Cube();
};


#endif
